﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Elysium.Controls;
using Elysium.Demo.Configuracion.Empresa;
using Elysium.Demo.Informes;
using SIIE_ERP.Codigo;

namespace Elysium.Demo.Inventarios
{
    /// <summary>
    /// Lógica de interacción para Menu_Configuracion.xaml
    /// </summary>
    public partial class Menu_Inventarios : UserControl
    {
        private UsuarioActivo _sesion;

        public Menu_Inventarios(ref UsuarioActivo usuario)
        {
            InitializeComponent();
            this._sesion = usuario;    
        }

        private void Expander_Catalogos_Expanded(object sender, RoutedEventArgs e)
        {
            if (Expander_Transacciones != null)
                Expander_Transacciones.IsExpanded = false;
            if (Expander_Reportes != null)
                Expander_Reportes.IsExpanded = false;  
        }

        private void Expander_Transacciones_Expanded(object sender, RoutedEventArgs e)
        {
            if (Expander_Catalogos != null)
                Expander_Catalogos.IsExpanded = false;
            if (Expander_Reportes != null)
                Expander_Reportes.IsExpanded = false;  
        }
        
        private void Expander_Reportes_Expanded_1(object sender, RoutedEventArgs e)
        {
            if (Expander_Transacciones != null)
                Expander_Transacciones.IsExpanded = false;
            if (Expander_Catalogos != null)
                Expander_Catalogos.IsExpanded = false;  
        }    

        private void ButtonArticulos_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.Articulos_Consulta(ref _sesion);
        }
        private void ButtonListaPrecios_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.Listas_Precios_Consulta(ref _sesion);
      
        }
        private void ButtonKits_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.Kit_Consulta(ref _sesion);
        }

        private void ButtonAlmacenes_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.Almacen_Consulta(ref _sesion);
        }

        private void ButtonUnidadesDeMedida_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.UnidadMedida_Consulta(ref _sesion);
        }

        private void ButtonGrupoDeProducto_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.GrupoProductos_Consulta(ref _sesion);
        }

        private void ButtonSubgrupoDeProducto_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.SubGrupoProductos_Consulta(ref _sesion);
        }

        private void ButtonLineas_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.Lineas_Consulta(ref _sesion);
        }

        private void ButtonTiposDeMovimiento_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Catalogos.TiposMovimientos_Consulta(ref _sesion);
        }

        private void ButtonMovimientos_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Transacciones.MovimientoInventario_Consulta(ref _sesion);
        }

        private void ButtonTraspasos_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Transacciones.Traspaso_Consulta(ref _sesion);
        }

        private void ButtonInventarioFisico_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewInventarios.Content = new Transacciones.InventarioFisico_Consulta(ref _sesion);
        }
        private void ButtonReporte1_Click_1(object sender, RoutedEventArgs e)
        {
            System.Windows.Window window = new System.Windows.Window
            {
                Title = "Costos de Inventario",
                Content = new ScrollViewer()
                {
                    Content = new Seleccion_Inventarios_Existencias(ref _sesion, true),
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto
                },
                Height = 585,
                Width = 1335,
                WindowStyle = System.Windows.WindowStyle.ToolWindow,
                ResizeMode = ResizeMode.CanResize,
                WindowState = WindowState.Normal,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                Icon = new BitmapImage(new Uri("pack://application:,,,/Imagenes/SIE.ico")),
            };

            window.Show();

            //Elysium.Demo.Informes.Seleccion_Inventarios_Existencias MiReporte = new Informes.Seleccion_Inventarios_Existencias(ref _sesion, true);

            //Viewbox MiVB = new Viewbox();
            //MiVB.Child = MiReporte;

            //ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            //ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            //ScrollViewInventarios.MaxWidth = 1200;
            //ScrollViewInventarios.MaxHeight = 526;

            //ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte2_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.Seleccion_Inventarios_Articulos MiReporte = new Informes.Seleccion_Inventarios_Articulos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Articulos.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte3_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.Seleccion_Inventarios_Articulos MiReporte = new Informes.Seleccion_Inventarios_Articulos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Kits.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte4_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.GenericReport MiReporte = new Informes.GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Almacenes.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte5_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.GenericReport MiReporte = new Informes.GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/UM.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte6_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.GenericReport MiReporte = new Informes.GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Grupos_Producto.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte7_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.GenericReport MiReporte = new Informes.GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/SubGrupos_Producto.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte8_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.GenericReport MiReporte = new Informes.GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Lineas_Producto.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte9_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.GenericReport MiReporte = new Informes.GenericReport(ref _sesion, "Informes/Reportes/Operativos/Inventarios/Tipos_Mov_Inventario.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporte10_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.Seleccion_Inventarios_Movimientos MiReporte = new Informes.Seleccion_Inventarios_Movimientos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/MovsInventario.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;

        }

        private void ButtonReporte11_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.Seleccion_Inventarios_Traspasos MiReporte = new Informes.Seleccion_Inventarios_Traspasos(ref _sesion, "Informes/Reportes/Operativos/Inventarios/TraspasoAlmacen.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;
            
            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;

        }

        private void ButtonReporteNuevoExistencias_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.Seleccion_Inventarios_NuevoReporteExistencias MiReporte = new Informes.Seleccion_Inventarios_NuevoReporteExistencias(ref _sesion, "Informes/Reportes/Operativos/Inventarios/NuevoReporteExistencias.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

        private void ButtonReporteMovimientosPorArticulo_Click_1(object sender, RoutedEventArgs e)
        {
            Elysium.Demo.Informes.Seleccion_Inventarios_MovimientosPorArticulo MiReporte = new Informes.Seleccion_Inventarios_MovimientosPorArticulo(ref _sesion, "Informes/Reportes/Operativos/Inventarios/MovsInventario.rdlc", true);

            Viewbox MiVB = new Viewbox();
            MiVB.Child = MiReporte;

            ScrollViewInventarios.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            ScrollViewInventarios.MaxWidth = 1200;
            ScrollViewInventarios.MaxHeight = 526;

            ScrollViewInventarios.Content = MiVB;
        }

     
    }
}
